import requests
from lxml import etree
if __name__ == "__main__":
    # 爬取页面源码数据
    headers = {
        'user-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36'
    }
    url = 'http://ip.293.net/'
    page_text = requests.get(url=url,headers=headers,proxies={"https":'43.243.166.222:8080'}).text

    with open('ip.html','w',encoding='utf-8') as fp:
        fp.write((page_text))
        print('靓仔搞定！')